package cn.t12.qg.userprovider.mapper;

import com.qg.pojo.QgUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("SELECT `id`, `phone`, `password`, `wxUserId`, `realName`, `createdTime`, `updatedTime` FROM  `qg_user` where phone=#{phone} ")
    QgUser selectByPhone(@Param("phone") String phone);

    @Select("select `id`, `phone`, `password`, `wxUserId`, `realName`, `createdTime`, `updatedTime` from qg_user where wxUserId = #{openId}")
    QgUser selectByOpenId(@Param("openId")String openId);

    @Insert("insert into qg_user(`id`,`phone`, `password`, `wxUserId`, `realName`, `createdTime`) values(#{id},#{phone},#{password},#{wxUserId},#{realName},#{createdTime})")
    int insertQgUser(QgUser qgUser);
}


